﻿@model PlmTurnoverViewModel
@{
    Layout = null;
    ViewBag.Title = "人员变动审核列表";
}
<script type="text/javascript">
    $(document).ready(function () {
        getSection();
    });
    function getSection() {
        $.getJSON(
            "/PersonnelLog/PlmTurnover/GetSection?id=all",
            function (data) {
                $.each(data, function (i, item) {
                    $("<option></option>").val(item["UNIT_ID"]).text(item["UNIT_CODE"]).appendTo($("#sectionname"));
                })
            }
            )
        $("#sectionname").change(
            function () {
                var selectedId = $("#sectionname").val();
                $("#positionname").empty();
                if (selectedId != null) {
                    $.getJSON(
                        "/PersonnelLog/PlmTurnover/GetPositionBySectionID?id=" + selectedId + "",
                        function (data) {
                            $.each(data, function (i, item) {
                                $("<option>=请选择=</option>").val(item["Scd_ID"]).text(item["Scd_Name"]).appendTo("#positionname");
                            })
                        }
                        )
                }


            }
            )
    }
</script>

<div class="pageHeader">
    @using (Html.BeginForm("SplitPage", "PlmTurnoverCheck", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return navTabSearch(this);" }))
    {
        <input type="hidden" name="pageNum" value="1" />
        <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>姓名：</td>
                    <td>
                        <input type="text" name="name" value="@(ViewBag.name)" />
                    </td>
                    <td>所属标段：</td>
                    <td>
                        <input type="text" name="sectionname" value="@(ViewBag.sectionname)" />
                    </td>
                    <td>变动职位：</td>
                    <td>
                        <input type="text" name="positionname" value="@(ViewBag.positionname)" />
                    </td>
                    <td>申报日期：<input type="text" name="reporttime" class="date" value="@(ViewBag.reporttime)" />
                    </td>
                    <td>
                        <button type="submit" class="btn btn-success btn-xs">搜索</button>
                    </td>
                </tr>
            </table>
        </div>
    }
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li>
                @Html.PermissionButton("PersonnelLog.PlmTurnoverCheck.Detail", "PersonnelLog_PlmTurnoverCheck_TurnoverCheckDetail",
                    Url.Action("TurnoverCheckDetail", "PlmTurnoverCheck", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","rygl_jlry_detail"} ,{"warn","请选择一条信息！"},{"target","dialog"},{"mask","true"},{"width","720"},{"height","400"}
                    })
            </li>


        </ul>
    </div>
    <table class="table" width="100%" layouth="88">
        <thead>
            <tr>

                <th align="center">序号</th>
                <th align="center">变动职位</th>
                <th align="center">所属标段</th>
                <th align="center">现职人员</th>
                <th align="center">变更人员</th>
                <th align="center">申报日期</th>
                <th align="center">变动类型</th>
                <th align="center">状态</th>
                <th align="center">操作</th>
            </tr>
        </thead>
        <tbody>
            @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
            @foreach (var item in Model.ThePlmTurnoverInfoList)
            {
                num++;
                <tr target="ids" rel="@item.T_ID">
                    <td>@num</td>
                    <td>@item.T_Position</td>
                    <td>@item.T_SectionName</td>
                    <td>@item.T_ExistingStaff</td>
                    <td>@item.T_ChangePersonnel</td>
                    <td>@item.T_DeclarationDate.ToString("yyyy-MM-dd")</td>
                    <td>@item.T_Type</td>
                    <td>@item.T_State</td>
                    <td>
                        @* <a title="查看" target="dialog" href="@Url.Action("TurnoverCheckDetail", "PlmTurnoverCheck", new { id = @item.T_ID})" class="detail" mask="true" width="480px" height="600px">查看</a>*@
                        @if (@item.T_State == "待审核")
                        {
                       
                            <a title="审核" mask="true" target="dialog" width="500" height="222" rel="rybd_bdsp" href="@Url.Action("TurnoverCheckAudit", "PlmTurnoverCheck", new { id = @item.T_ID })" class="btnAssign">审核</a>
                        }

                    </td>
                </tr>
            }
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages" style=" float:right">
            <span>显示</span>
            <select class="comsplitpage" id="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
              <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
                <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
                <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
            </select>
            <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
        </div>
        <div class="pagination" style="margin:0px;float:left; margin-left:35%" targettype="navTab" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)"></div>

    </div>
</div>

